﻿@namespace Blazorise
@inherits BaseValidationResult
@if ( ParentValidation?.Status == ValidationStatus.Error )
{
    <div @ref="@ElementRef" id="@ElementId" class="@ClassNames" style="@StyleNames" @attributes="@Attributes">
        @if ( ChildContent is not null )
        {
            @ChildContent
        }
        else if ( ErrorMessages is not null && ErrorMessages.Any() )
        {
            @if ( Multiline )
            {
                <OrderedList Unstyled>
                    @foreach ( var errorMessage in ErrorMessages )
                    {
                        <OrderedListItem @key="@errorMessage">@errorMessage</OrderedListItem>
                    }
                </OrderedList>
            }
            else
            {
                @string.Join(";", ErrorMessages)
            }
        }
    </div>
}